package com.lfs.market.model.vo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author lfs
 * @date 2025/6/24 13:52:44
 */
@Data
@HeadRowHeight(value = 30) // 头部行高
@ContentRowHeight(value = 25) // 内容行高
@ColumnWidth(value = 20) // 列宽
/*
  @OnceAbsoluteMerge 指定从哪一行/列开始,哪一行/列结束,进行单元格合并
 * firstRowIndex 起始行索引,从0开始
 * lastRowIndex 结束行索引
 * firstColumnIndex 起始列索引,从0开始
 * lastColumnIndex 结束列索引
 */
public class OrderExcelVo {
    /**
     * 订单编号
     */
    @ApiModelProperty("订单编号")
    @ExcelProperty(value = {"订单编号"}, index = 0)
    // 忽略导出字段
//    @ExcelIgnore
    private String orderNo;

    /**
     * 商品名称
     */
    @ApiModelProperty("商品名称")
    @ExcelProperty(value = {"商品名称"}, index = 1)
    private String productName;

    /**
     * 商品数量
     */
    @ApiModelProperty("商品数量")
    @ExcelProperty(value = {"商品数量"}, index = 2)
    private Integer productNum;

    /**
     * 总价格
     */
    @ApiModelProperty("总价格")
    @ExcelProperty(value = {"总价格"}, index = 3)
    private BigDecimal totalPrice;

    /**
     * 支付编号
     */
    @ApiModelProperty(value = "支付编号")
    @ExcelProperty(value = "支付编号", index = 4)
    private String payNo;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelProperty(value = "创建时间", index = 5)
    @DateTimeFormat(value = "yyyy年MM月dd日 HH时mm分ss秒") // 日期格式化
    private Date createTime;
}
